<template>
  <!--
    作者：luoyiming
    时间：2020-06-04
    描述：插件中心-积分商城-商品设置-编辑商品-其它
  -->
  <div>
    <div class="common-form">其它</div>

    <el-form-item label="优惠类型" >
      <el-radio-group  v-model="form.activity_type" disabled>
        <el-radio :label="1">按件数打折</el-radio>
        <el-radio :label="2">首件优惠，按x件起购</el-radio>
        <el-radio :label="3">满x件赠y件</el-radio>
      </el-radio-group>
    </el-form-item>
    
    <div v-if="form.activity_type ==1">
      <div class="d-s-c pt16 max-w460 active-all-set"  v-for="(item, index) in form.rebate_json" :key="index" >
        <el-form-item label="件数"  :rules="[{ required: true, message: '请填写件数' }]"><el-input disabled type="number"  min="0" placeholder="件数" v-model="item.num" style="width: 100px;"></el-input></el-form-item>
        <el-form-item label="优惠折扣" :rules="[{ required: true, message: '请填写优惠折扣' }]"><el-input disabled type="number"  min="0" placeholder="优惠折扣" v-model="item.rebate" style="width: 100px;"></el-input></el-form-item>
  
      </div>
    
     
    </div>

    <div v-if="form.activity_type ==2">
      <el-form-item label="首件价格" prop="first_price" :rules="[{ required: true, message: '请填写价格' }]"><el-input  disabled type="number" v-model="form.first_price" class="max-w460"></el-input></el-form-item>
      <el-form-item label="起购数量" prop="start_buy_num" :rules="[{ required: true, message: '请填写起购数量' }]"><el-input disabled type="number" v-model="form.start_buy_num" class="max-w460"></el-input></el-form-item>
    </div>
    <div v-if="form.activity_type ==3">
      <el-form-item label="满购数量" prop="buy_num" :rules="[{ required: true, message: '请填写满购数量' }]"><el-input disabled type="number" v-model="form.buy_num" class="max-w460"></el-input></el-form-item>
      <el-form-item label="赠送数量" prop="gift_num" :rules="[{ required: true, message: '请填写赠送数量' }]"><el-input disabled type="number" v-model="form.gift_num" class="max-w460"></el-input></el-form-item>
      <el-form-item label="优惠金额" prop="discount_moeny"><el-input disabled type="number" v-model="form.discount_moeny" class="max-w460"></el-input></el-form-item>
    </div>

    <el-form-item label="限购数量" prop="limit_num" :rules="[{ required: true, message: '请填写限购数量' }]"><el-input disabled type="number" v-model="form.limit_num" class="max-w460"></el-input></el-form-item>
    

    
  </div>
</template>

<script>
export default {
  inject: ['form']
};
</script>

<style></style>
